home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0105_VGA Detection.pas < prev    next >
Pascal/Delphi Source File  |  1994-05-25  |  818b  |  40 lines

  1. {
  2. PF> Can anyone give me the source code for a vga detection
  3. PF> routine taht doesnt use the bgi driver. Thanks in advance PF> for your
  4. help.
  5.  
  6. PF> Patrick Fox
  7.  
  8. To detect a VGA card simply <g> call Interrupt 10h with ah set as 1Ah, if al is
  9. now 1A then there is a VGA present - otherwise it must be something else...
  10.  
  11. i.e. ( regs is declared as of type registers from the DOS unit)
  12. }
  13.  
  14. begin
  15.   with regs do
  16.    begin
  17.     ah:=$1A;
  18.     al:=00;
  19.     intr ($10, regs);
  20.     If al=$1A then Writeln ('VGA Detected...'); {or whatever...}
  21.    end;
  22. end.
  23.  
  24. or in the built-in assembler something like this...
  25.  
  26. Function isVGA:Boolean; Assembler;
  27.  
  28. asm
  29.    mov AH, $1A
  30.    mov al, $00
  31.    Int $10
  32.    cmp al, $1A
  33.    jne @@NOVGABIOS
  34.    mov al, 1
  35.    jmp @@EXIT
  36.   @@NOVGABIOS:
  37.    mov al, 0
  38.   @@EXIT:
  39. end;
  40.